<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <title>{{ user.name }}'s Watchlist</title>
</head>
<body>
    <h2>Welcome, {{ user.name }}!</h2>

    {# 使用 length 过滤器获取 movies 变量的长度 #}
    <p>豆瓣电影一周口碑榜  Top {{ movies|length }}</p>
    <ul class="movie-list">
        {% for movie in movies %}  {# 迭代 movies 变量 #}
        <li>{{ movie.title }} - {{ movie.year }}</li>  {# 等同于 movie['title'] #}
        {% endfor %}  {# 使用 endfor 标签结束 for 语句 #}
    </ul>

    <footer>
        <img class="totoro" src="{{ url_for('static', filename='images/icon-footer-bx.png') }}">
        <small>&copy; 2018 <a href="http://helloflask.com/tutorial">HelloFlask</a></small>
    </footer>
</body>
</html>